Integrand size = 26, antiderivative size = 141 \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=-\frac {a \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{2 \left (a^2+b^2\right )^{5/2} d}-\frac {b}{3 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^3}-\frac {a (b \cos (c+d x)-a \sin (c+d x))}{2 \left (a^2+b^2\right )^2 d (a \cos (c+d x)+b \sin (c+d x))^2} \]
[Out]
Time = 0.13 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3237, 12, 3155, 3153, 212} \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=-\frac {a \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{2 d \left (a^2+b^2\right )^{5/2}}-\frac {b}{3 d \left (a^2+b^2\right ) (a \cos (c+d x)+b \sin (c+d x))^3}-\frac {a (b \cos (c+d x)-a \sin (c+d x))}{2 d \left (a^2+b^2\right )^2 (a \cos (c+d x)+b \sin (c+d x))^2} \]
[In]
[Out]
Rule 12
Rule 212
Rule 3153
Rule 3155
Rule 3237
Rubi steps \begin{align*} \text {integral}& = -\frac {b}{3 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^3}+\frac {\int \frac {3 a}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx}{3 \left (a^2+b^2\right )} \\ & = -\frac {b}{3 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^3}+\frac {a \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^3} \, dx}{a^2+b^2} \\ & = -\frac {b}{3 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^3}-\frac {a (b \cos (c+d x)-a \sin (c+d x))}{2 \left (a^2+b^2\right )^2 d (a \cos (c+d x)+b \sin (c+d x))^2}+\frac {a \int \frac {1}{a \cos (c+d x)+b \sin (c+d x)} \, dx}{2 \left (a^2+b^2\right )^2} \\ & = -\frac {b}{3 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^3}-\frac {a (b \cos (c+d x)-a \sin (c+d x))}{2 \left (a^2+b^2\right )^2 d (a \cos (c+d x)+b \sin (c+d x))^2}-\frac {a \text {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,b \cos (c+d x)-a \sin (c+d x)\right )}{2 \left (a^2+b^2\right )^2 d} \\ & = -\frac {a \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{2 \left (a^2+b^2\right )^{5/2} d}-\frac {b}{3 \left (a^2+b^2\right ) d (a \cos (c+d x)+b \sin (c+d x))^3}-\frac {a (b \cos (c+d x)-a \sin (c+d x))}{2 \left (a^2+b^2\right )^2 d (a \cos (c+d x)+b \sin (c+d x))^2} \\ \end{align*}
Time = 1.32 (sec) , antiderivative size = 128, normalized size of antiderivative = 0.91 \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\frac {\frac {6 a \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{5/2}}+\frac {-4 b \left (a^2+b^2\right )-6 a^2 b \cos (2 (c+d x))+3 \left (a^3-a b^2\right ) \sin (2 (c+d x))}{2 \left (a^2+b^2\right )^2 (a \cos (c+d x)+b \sin (c+d x))^3}}{6 d} \]
[In]
[Out]
Result contains complex when optimal does not.
Time = 1.21 (sec) , antiderivative size = 335, normalized size of antiderivative = 2.38
method | result | size |
risch | \(-\frac {i \left (-8 i b^{3} {\mathrm e}^{3 i \left (d x +c \right )}-8 i a^{2} b \,{\mathrm e}^{3 i \left (d x +c \right )}+3 a \,b^{2} {\mathrm e}^{i \left (d x +c \right )}-6 i a^{2} b \,{\mathrm e}^{i \left (d x +c \right )}+3 a^{3} {\mathrm e}^{5 i \left (d x +c \right )}-6 i a^{2} b \,{\mathrm e}^{5 i \left (d x +c \right )}-3 a \,b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-3 a^{3} {\mathrm e}^{i \left (d x +c \right )}\right )}{3 \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+{\mathrm e}^{2 i \left (d x +c \right )} a +i b +a \right )^{3} \left (i b +a \right )^{2} d \left (-i b +a \right )^{2}}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{5}+2 i a^{3} b^{2}+i a \,b^{4}-a^{4} b -2 a^{2} b^{3}-b^{5}}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{2 \left (a^{2}+b^{2}\right )^{\frac {5}{2}} d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{5}+2 i a^{3} b^{2}+i a \,b^{4}-a^{4} b -2 a^{2} b^{3}-b^{5}}{\left (a^{2}+b^{2}\right )^{\frac {5}{2}}}\right )}{2 \left (a^{2}+b^{2}\right )^{\frac {5}{2}} d}\) | \(335\) |
derivativedivides | \(\frac {-\frac {2 \left (-\frac {\left (a^{4}+4 a^{2} b^{2}+2 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 a \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {b \left (a^{4}-8 a^{2} b^{2}-4 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 a^{2} \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {b^{2} \left (15 a^{4}-4 a^{2} b^{2}-4 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a^{3} \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {b \left (2 a^{4}-5 a^{2} b^{2}-2 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a^{2} \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {\left (a^{4}-6 a^{2} b^{2}-2 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {b \left (5 a^{2}+2 b^{2}\right )}{6 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )^{3}}+\frac {a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \sqrt {a^{2}+b^{2}}}}{d}\) | \(383\) |
default | \(\frac {-\frac {2 \left (-\frac {\left (a^{4}+4 a^{2} b^{2}+2 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 a \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {b \left (a^{4}-8 a^{2} b^{2}-4 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2 a^{2} \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {b^{2} \left (15 a^{4}-4 a^{2} b^{2}-4 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 a^{3} \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {b \left (2 a^{4}-5 a^{2} b^{2}-2 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a^{2} \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}+\frac {\left (a^{4}-6 a^{2} b^{2}-2 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}-\frac {b \left (5 a^{2}+2 b^{2}\right )}{6 \left (a^{4}+2 a^{2} b^{2}+b^{4}\right )}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )^{3}}+\frac {a \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{4}+2 a^{2} b^{2}+b^{4}\right ) \sqrt {a^{2}+b^{2}}}}{d}\) | \(383\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 420 vs. \(2 (131) = 262\).
Time = 0.27 (sec) , antiderivative size = 420, normalized size of antiderivative = 2.98 \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\frac {2 \, a^{4} b - 2 \, a^{2} b^{3} - 4 \, b^{5} - 12 \, {\left (a^{4} b + a^{2} b^{3}\right )} \cos \left (d x + c\right )^{2} + 6 \, {\left (a^{5} - a b^{4}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 3 \, {\left (3 \, a^{2} b^{2} \cos \left (d x + c\right ) + {\left (a^{4} - 3 \, a^{2} b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (a b^{3} + {\left (3 \, a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right )}{12 \, {\left ({\left (a^{9} - 6 \, a^{5} b^{4} - 8 \, a^{3} b^{6} - 3 \, a b^{8}\right )} d \cos \left (d x + c\right )^{3} + 3 \, {\left (a^{7} b^{2} + 3 \, a^{5} b^{4} + 3 \, a^{3} b^{6} + a b^{8}\right )} d \cos \left (d x + c\right ) + {\left ({\left (3 \, a^{8} b + 8 \, a^{6} b^{3} + 6 \, a^{4} b^{5} - b^{9}\right )} d \cos \left (d x + c\right )^{2} + {\left (a^{6} b^{3} + 3 \, a^{4} b^{5} + 3 \, a^{2} b^{7} + b^{9}\right )} d\right )} \sin \left (d x + c\right )\right )}} \]
[In]
[Out]
Timed out. \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=\text {Timed out} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 606 vs. \(2 (131) = 262\).
Time = 0.34 (sec) , antiderivative size = 606, normalized size of antiderivative = 4.30 \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=-\frac {\frac {3 \, a \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} + \frac {2 \, {\left (5 \, a^{5} b + 2 \, a^{3} b^{3} - \frac {3 \, {\left (a^{6} - 6 \, a^{4} b^{2} - 2 \, a^{2} b^{4}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {6 \, {\left (2 \, a^{5} b - 5 \, a^{3} b^{3} - 2 \, a b^{5}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {2 \, {\left (15 \, a^{4} b^{2} - 4 \, a^{2} b^{4} - 4 \, b^{6}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, {\left (a^{5} b - 8 \, a^{3} b^{3} - 4 \, a b^{5}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {3 \, {\left (a^{6} + 4 \, a^{4} b^{2} + 2 \, a^{2} b^{4}\right )} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{10} + 2 \, a^{8} b^{2} + a^{6} b^{4} + \frac {6 \, {\left (a^{9} b + 2 \, a^{7} b^{3} + a^{5} b^{5}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, {\left (a^{10} - 2 \, a^{8} b^{2} - 7 \, a^{6} b^{4} - 4 \, a^{4} b^{6}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {4 \, {\left (3 \, a^{9} b + 4 \, a^{7} b^{3} - a^{5} b^{5} - 2 \, a^{3} b^{7}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, {\left (a^{10} - 2 \, a^{8} b^{2} - 7 \, a^{6} b^{4} - 4 \, a^{4} b^{6}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {6 \, {\left (a^{9} b + 2 \, a^{7} b^{3} + a^{5} b^{5}\right )} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {{\left (a^{10} + 2 \, a^{8} b^{2} + a^{6} b^{4}\right )} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}}}{6 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 426 vs. \(2 (131) = 262\).
Time = 0.39 (sec) , antiderivative size = 426, normalized size of antiderivative = 3.02 \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=-\frac {\frac {3 \, a \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (3 \, a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 24 \, a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 12 \, a b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 30 \, a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 8 \, a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 8 \, b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 30 \, a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, a^{5} b + 2 \, a^{3} b^{3}\right )}}{{\left (a^{7} + 2 \, a^{5} b^{2} + a^{3} b^{4}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )}^{3}}}{6 \, d} \]
[In]
[Out]
Time = 26.97 (sec) , antiderivative size = 505, normalized size of antiderivative = 3.58 \[ \int \frac {\cos (c+d x)}{(a \cos (c+d x)+b \sin (c+d x))^4} \, dx=-\frac {\frac {\frac {5\,a^2\,b}{3}+\frac {2\,b^3}{3}}{a^4+2\,a^2\,b^2+b^4}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (-a^4\,b+8\,a^2\,b^3+4\,b^5\right )}{a^2\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (-4\,a^4\,b+10\,a^2\,b^3+4\,b^5\right )}{a^2\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (-a^4+6\,a^2\,b^2+2\,b^4\right )}{a\,\left (a^4+2\,a^2\,b^2+b^4\right )}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (a^4+4\,a^2\,b^2+2\,b^4\right )}{a\,\left (a^4+2\,a^2\,b^2+b^4\right )}-\frac {2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (5\,a^2\,b+2\,b^3\right )\,\left (3\,a^2-2\,b^2\right )}{3\,a^3\,\left (a^4+2\,a^2\,b^2+b^4\right )}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (12\,a\,b^2-3\,a^3\right )-a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (12\,a\,b^2-3\,a^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (12\,a^2\,b-8\,b^3\right )+a^3+6\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\right )}-\frac {a\,\mathrm {atanh}\left (\frac {a^4\,b+2\,a^2\,b^3+b^5}{{\left (a^2+b^2\right )}^{5/2}}-\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^4+2\,a^2\,b^2+b^4\right )}{{\left (a^2+b^2\right )}^{5/2}}\right )}{d\,{\left (a^2+b^2\right )}^{5/2}} \]
[In]
[Out]